home *** CD-ROM | disk | FTP | other *** search
- (**************************************************************************
-
- $RCSfile: Serial.mod $
- Description: external declarations for the serial device
-
- Created by: fjc (Frank Copeland)
- $Revision: 3.8 $
- $Author: fjc $
- $Date: 1995/06/04 23:13:14 $
-
- $VER: serial.h 33.6 (6.11.90)
- Includes Release 40.15
-
- (C) Copyright 1985-1993 Commodore-Amiga, Inc.
- All Rights Reserved
-
- Oberon-A interface Copyright © 1994-1995, Frank Copeland.
- This file is part of the Oberon-A Interface.
- See Oberon-A.doc for conditions of use and distribution.
-
- ***************************************************************************)
-
- <* STANDARD- *>
-
- MODULE [2] Serial;
-
- IMPORT e := Exec, s := Sets;
-
-
- (* array of termination char's *)
- (* to use,see serial.doc setparams *)
-
- TYPE
-
- IOTArrayPtr * = POINTER TO IOTArray;
- IOTArray * = ARRAY 8 OF CHAR;
-
- CONST
-
- defaultCtlChar * = 11130000H; (* default chars for xON,xOFF *)
-
- (* You may change these via SETPARAMS. At this time, parity is not
- calculated for xON/xOFF characters. You must supply them with the
- desired parity. *)
-
- (******************************************************************)
- (* CAUTION !! IF YOU ACCESS the serial.device, you MUST (!!!!) use an
- IOExtSer-sized structure or you may overlay innocent memory !! *)
- (******************************************************************)
-
- TYPE
-
- IOExtSerPtr * = POINTER TO IOExtSer;
- IOExtSer * = RECORD (e.IORequestBase)
- ioSer * : e.IOStdReq;
- ctlChar * : e.ULONG; (* control char's (order = xON,xOFF,INQ,ACK) *)
- rBufLen * : e.ULONG; (* length in bytes of serial port's read buffer *)
- extFlags * : s.SET32; (* additional serial flags (see bitdefs below) *)
- baud * : e.ULONG; (* baud rate requested (true baud) *)
- brkTime * : e.ULONG; (* duration of break signal in MICROseconds *)
- termArray * : IOTArray; (* termination character array *)
- readLen * : SHORTINT; (* bits per read character (# of bits) *)
- writeLen * : SHORTINT; (* bits per write character (# of bits) *)
- stopBits * : SHORTINT; (* stopbits for read (# of bits) *)
- serFlags * : s.SET8; (* see SerFlags bit definitions below *)
- status * : s.SET16;
- END; (* IOExtSer *)
-
- (* status of serial port, as follows:
- * BIT ACTIVE FUNCTION
- * 0 --- reserved
- * 1 --- reserved
- * 2 high Connected to parallel "select" on the A1000.
- * Connected to both the parallel "select" and
- * serial "ring indicator" pins on the A500
- * & A2000. Take care when making cables.
- * 3 low Data Set Ready
- * 4 low Clear To Send
- * 5 low Carrier Detect
- * 6 low Ready To Send
- * 7 low Data Terminal Ready
- * 8 high read overrun
- * 9 high break sent
- * 10 high break received
- * 11 high transmit x-OFFed
- * 12 high receive x-OFFed
- * 13-15 reserved
- *)
-
- CONST
-
- query * = e.nonstd; (* $09 *)
- break * = e.nonstd+1; (* $0A *)
- setParams * = e.nonstd+2; (* $0B *)
-
-
- xDisabled * = 7; (* ioSerFlags xOn-xOff feature disabled bit *)
- eofMode * = 6; (* " EOF mode enabled bit *)
- shared * = 5; (* " non-exclusive access bit *)
- radBoogie * = 4; (* " high-speed mode active bit *)
- queuedBrk * = 3; (* " queue this Break ioRqst *)
- sevenWire * = 2; (* " RS232 7-wire protocol *)
- partyOdd * = 1; (* " parity feature enabled bit *)
- partyOn * = 0; (* " parity-enabled bit *)
-
- (* These now refect the actual bit positions in the ioStatus UWORD *)
- xOffRead * = 12; (* ioStatus receive currently xOFF'ed bit *)
- xOffWrite * = 11; (* " transmit currently xOFF'ed bit *)
- readBreak * = 10; (* " break was latest input bit *)
- wroteBreak * = 9; (* " break was latest output bit *)
- overRun * = 8; (* " status word RBF overrun bit *)
-
-
- mSpOn * = 1; (* ioExtFlags. Use mark-space parity, *)
- (* instead of odd-even. *)
- mark * = 0; (* " if mark-space, use mark *)
-
-
- devBusy * = 1;
- baudMismatch * = 2; (* baud rate not supported by hardware *)
- bufErr * = 4; (* Failed to allocate new read buffer *)
- invParam * = 5;
- lineErr * = 6;
- parityErr * = 9;
- timerErr * = 11; (*(See the serial/OpenDevice autodoc)*)
- bufOverflow * = 12;
- noDSR * = 13;
- detectedBreak * = 15;
-
- serialName * = "serial.device";
-
- END Serial.
-